import { axios } from '@/utils/request'
const urlList = {
    getUsers: '/sys/user/list',
    getCourseById: '/cscourse/csCourse/queryById',
    getSubjects: '/subject/oesSubject/list',
    getCourseList: '/cscourse/csCourse/list',
    getUserCourseById: '/cscourse/csCourse/getCourseUser',
    getQuestionList: '/csquestionsandanswers/csQuestionsandanswers/list',
    pushQuestion: '/csquestionsandanswers/csQuestionsandanswers/add',
    deleteQuestion: '/csquestionsandanswers/csQuestionsandanswers/delete',
    getReplyList: '/csquestionsandanswers/csQuestionsandanswers/queryAnswerList',
    setLike: '/csquestionsandanswers/csQuestionsandanswers/setSatisfied',
    setUnLike: '/csquestionsandanswers/csQuestionsandanswers/cancelSatisfied',
    setPraise: '/csanswerlike/csAnswerLike/add',
    unPraise: '/csanswerlike/csAnswerLike/delete',
    getPrivateNote: '/csnote/csNote/privateNoteList',
    editNote: '/csnote/csNote/edit',
    addNote: '/csnote/csNote/add',
    deleteNote: '/csnote/csNote/delete',
    getPublicNote: '/csnote/csNote/publicNoteList',
    notePraise: '/csnotelike/csNoteLike/add',
    unNotePraise: '/csnotelike/csNoteLike/delete'
}

export function getUsers(parameter) {
return axios({
    url: urlList.getUsers,
    method: 'get',
    params: parameter
})
}

export function getCourseById(parameter) {
return axios({
    url: urlList.getCourseById,
    method: 'get',
    params: parameter
})
}

export function getSubjects(parameter){
  return axios({
    url: urlList.getSubjects,
    method: 'get',
    params: parameter
  })
}

export function getCourseList(parameter){
  return axios({
    url: urlList.getCourseList,
    method: 'get',
    params: parameter
  })
}

export function getUserCourseById(parameter){
  return axios({
    url: urlList.getUserCourseById,
    method: 'get',
    params: parameter
  })
}

export function getQuestionList(parameter) {
  return axios({
    url: urlList.getQuestionList,
    method: 'get',
    params: parameter
  })
}

export function pushQuestion(data) {
  return axios({
    url: urlList.pushQuestion,
    method: 'post',
    data: data
  })
}

export function getReplyList(parameter) {
  return axios({
    url: urlList.getReplyList,
    method: 'get',
    params: parameter
  })
}

export function setLike(data) {
  return axios({
    url: urlList.setLike,
    method: 'put',
    data: data
  })
}
export function setUnLike(data) {
  return axios({
    url: urlList.setUnLike,
    method: 'put',
    data: data
  })
}

export function setPraise(data){
  return axios({
    url: urlList.setPraise,
    method: 'post',
    data: data
  })
}
export function unPraise(params){
  return axios({
    url: urlList.unPraise,
    method: 'delete',
    params: params
  })
}
export function deleteQuestion(params){
  return axios({
    url: urlList.deleteQuestion,
    method: 'delete',
    params: params
  })
}

export function getPrivateNote(params) {
  return axios({
    url: urlList.getPrivateNote,
    method: 'get',
    params: params
  })
}

export function editNote(data){
  return axios({
    url: urlList.editNote,
    method: 'put',
    data: data
  })
}

export function addNote(data){
  return axios({
    url: urlList.addNote,
    method: 'post',
    data: data
  })
}

export function deleteNote(params){
  return axios({
    url: urlList.deleteNote,
    method: 'delete',
    params: params
  })
}

export function getPublicNote(params){
  return axios({
    url: urlList.getPublicNote,
    method: 'get',
    params: params
  })
}

export function notePraise(data){
  return axios({
    url: urlList.notePraise,
    method: 'post',
    data: data
  })
}
export function unNotePraise(params){
  return axios({
    url: urlList.unNotePraise,
    method: 'delete',
    params: params
  })
}
